package cn.maihe.elg.operation.model.enums;

import java.util.Arrays;

/**
 * @Description 理赔审核状态
 * @Author WJH
 * @Date 2021/03/25
 */
public enum RefundAuditStatus {
    NO_PAYOUTS(0, "不予赔付"),
    PAID(1, "已赔付"),
    NOT_PASSED(2, "不通过"),

    ;
    /**
     * 售后订单类型
     */
    public static final Integer orderType = 2;


    private int status;
    private String desc;

    RefundAuditStatus(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public int getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

    public static RefundAuditStatus resolve(int status) {
        return Arrays.stream(values()).filter(v -> v.status == status).findFirst().orElseThrow(() -> new RuntimeException("受理订单状态值[" + status + "]有误"));
    }


    @Override
    public String toString() {
        return String.format("[%s:%s]",status,desc);
    }
}
